package com.jeesite.modules.pay.wxpay.weixin.Utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 微信的配置参数
 * @author iYjrg_xiebin
 * @date 2015年11月25日下午4:19:57
 */
@SuppressWarnings("unused")
public class WeixinConfigUtils {

	private static final Log log = LogFactory.getLog(WeixinConfigUtils.class);


//	public static String appid="wx23dd84a76ed30301";
//	public static String mch_id="1488360052";
//	public static String notify_url="http://192.168.3.65:8081/YNApi/appAuth/weixinPay/appApiPay/generateDirectPayParam?bizType=payTrade&bizId=31";
	
	
	   /**
     * 微信开发平台应用ID
     */
    public static final String APP_ID="wx23dd84a76ed30301";
    /**
     * 应用对应的凭证
     */
    public static final String APP_SECRET="ee7b3a9f6d412d754c25346291052034";
   
    /**
     * 微信支付商户号
     */
    public static final String MCH_ID="1488360052";
    /**
     * 商品描述
     */
    public static final String BODY="熊孩子-课程购买";
    
    
    /**5e35d8ac702f77f31f27bd1ed4da073a
     * 应用对应的密钥
     */
    public static final String APP_KEY="ee7b3a9f6d412d754c25346291052034";//签名
    /**
     * 商户号对应的密钥
     */
    public static final String PARTNER_key="dRU0abiAMi6TB8KuQerTv1x8aE41zNIL";
    
    /**
     * 商户id
     */
    public static final String PARTNER_ID="1488360052";
    /**
     * 常量固定值
     */
    public static final String GRANT_TYPE="client_credential";
    /**
     * 获取预支付id的接口url
     */
    public static String GATEURL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
    /**
     * 微信服务器回调通知url
     */
    public static String NOTIFY_URL="http://http://120.27.17.51:8080/app/tenpay/notify";
	/*static {
		ResourceBundle bundle = ResourceBundle.getBundle("resources/sys");
		appid = bundle.getString("appid");
		mch_id = bundle.getString("mch_id");
		notify_url = bundle.getString("notify_url");

		try{
		//	InputStream is = WeixinConfigUtils.class.getResourceAsStream("resources/sys.properties");
			Properties properties = new Properties();
			properties.load(is);
			
			appid = properties.getProperty("appid");
			mch_id = properties.getProperty("mch_id");
			notify_url = properties.getProperty("notify_url");
		}catch(Exception ex){
			log.debug("加载配置文件："+ex.getMessage());
		}
	}
*/

	public static void main(String[] args) throws IOException {
		InputStream is = WeixinConfigUtils.class.getResourceAsStream("/resources/sys.properties");

		Properties properties = new Properties();

		properties.load(is);

		is.close();
		String appid = properties.getProperty("appid");
		System.out.println(appid);
	}

}
